@import "../../../scss/plugin";

$fz-article: 15px;         // 日记内容字体大小
$fz-article-header: 13px;  // 日记头部字体大小
$fz-md-article: 14px;      // Markdown 内容的基础字体大小

.article{
  margin: 10px;
  overflow: hidden;
  font-size: $fz-article;
  background-color: white;
  @include border-radius($radius-mobile);
  border: 1px solid $color-border-light;

  .article-header{
    @extend .unselectable;
    text-align: center;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 15px;
    color: $text-subtitle;
    font-size: $fz-article-header;
    border-bottom: 1px solid $color-border-light;
    background-color: transparentize(black, 0.99);
    font-weight: bold;
    &.hidden{
      display: none !important;
    }
    & > *{
      padding-left: 30px;
    }
    &:active{
      transform: translateY(2px);
    }
    .week{
    }
    .weather{
      img{
        display: block;
        width: 20px;
      }
    }
    .date{
      font-family: "Galvji", sans-serif;
    }
    .category{
    }
  }
  .article-body{
    color: $bg-main;
    padding: 10px 15px;
    .title{
      font-weight: bold;
      line-height: 1.3;
      padding-bottom: 10px;
    }
    .content {
      white-space: pre-wrap;
      padding-bottom: 15px;
      color: $bg-main;
      line-height: 1.5;
      word-break: break-all;
      p {
      }
    }
    .markdown{
      padding-bottom: 15px;
    }
  }
  &.active{
    .article-header{
      color: white;
    }
  }
}

// on pc
@media (min-width: $grid-separate-width-md) {
  .article{
    font-size: $fz-md-article;
    &-header{
      justify-content: flex-end;
      padding: 8px 15px;
      & > *{
        padding-left: 30px;
      }
    }
    &-body{
      padding: 0 15px;
      .title{
      }
      .content{
        padding-bottom: 15px;
      }
    }
  }
}


@media (prefers-color-scheme: dark) {
  .article{
    border-color: $dark-border-active;
    background-color: $dark-list-bg;
    .article-header{
      border-bottom-color: $dark-border-active;
      //background-color: $dark-list-bg;
      color: $dark-text-title;
    }
    .article-body{
      background-color: $dark-list-bg;
      .title{
        color: $dark-text;
      }
      .content {
        color: $dark-text;
      }
    }
    &.active{
      .article-header{
        color: white;
      }
    }
  }

}
